<?php
/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2010 Albireo Solutions
 * @package    Kernel
 */
namespace KernelModule\AclModule;

use Albireo\MenuGenerator;

/**
 * Kernel ACL Overview presenter
 *
 * @author Pavel
 */
class OverviewPresenter extends BasePresenter {

    public function renderDefault() {
        if(!isset($this->template->title))$this->template->title = _("Access Control List Management");
        $this->showMenu();
        $this->showAclMenu();
    }

    protected function showAclMenu() {
        $aclImPrefix = "images/kernel/acl/";

        $items = array(
            'Kernel:Acl:Resources' => array("icon" => $aclImPrefix."resources.jpg", "title" => _("Resources")),
            'Kernel:Acl:Privileges' => array("icon" => $aclImPrefix."privileges.jpg", "title" => _("Privileges")),
            'Kernel:Acl:Permissions' => array("icon" => $aclImPrefix."permissions.jpg", "title" => _("Permissions"))
        );
        $menuGenerator = new MenuGenerator();
        $menu = $menuGenerator->universalMenu($this->getUser(), $items);

        $this->template->aclMenu = $menu;
    }

}